#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : HandleObj(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    handleButtonStyle(ui->musicButton, "MusicApp.png", this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_musicButton_clicked()
{
    this->close();
    music *musicWidget = new music();
    musicWidget->setWindowFlags(Qt::FramelessWindowHint);
    musicWidget->setAttribute(Qt::WA_TranslucentBackground);
    musicWidget->show();
}

// 事件过滤器
bool Widget::eventFilter(QObject *obj, QEvent *event)
{
    if(obj == ui->musicButton)
        handleButtonEvent(ui->musicButton, event);

    return QWidget::eventFilter(obj, event);
}
